package com.apex.order.controller;


import com.apex.model.bean.Order;
import com.apex.order.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @ClassName OrderController
 * @Description
 * @Author ZJX
 * @Date 2025/3/5 15:45
 * @Version 1.0
 **/
@RestController
@RequestMapping("/order")
@RefreshScope
public class OrderController {

    @Value("${order.timeout}")
    private String timeout;

    @Autowired
    private IOrderService orderService;

    @GetMapping("/create")
    public Order createOrder(Long productId, Long userId){
        return orderService.createOrder(productId,userId);
    }

    @GetMapping("/test")
    public void test(){
        System.out.println(timeout);
    }
}
